package cn.kgc.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true) //开启链式编程风格
@Builder                //对象构建器
public class Emp implements Serializable {
    private Integer id;
    @JsonProperty("username")
    private String name;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    //@JsonInclude(JsonInclude)
    private String sex;
    private Integer age;
    private String idType;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //@JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date birthday;
}
